<?php $this->load->view(TEMPLATE_NAME.'/admin/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.validate.pack.js"></script>
<script>
$(document).ready(function(){    
    $('#political_view').val('<?php echo $political_bias['political_view']?>');
    
    $('#political_bias_form').validate({
        rules : {
            political_view : "required"            
        },
	messages:{
            political_view : "Please select your political view"            
	}
    })                   
});
</script>
<div class="page noright adminpage adminuser">
    
    <?php $this->load->view(TEMPLATE_NAME.'/admin/profile/profile_tabs');?>
    <h2 class="no">Politics</h2>   
    <p class="black f13"><strong>Private and Confidential</strong>. All information here is <strong>not shared</strong> and is treated highly confidentially.<br />
    Information is simply aggregated to create a rough impression of the network and to allow decision makers to gain a better understanding of the area. This data serves as a more up-to-date census of the area in question.<br />
    Information from this section will only ever be presented as a group average. Under no circumstances will individual data ever be revealed. </p>
<?php if(!empty($notification)): ?>
<p><?php echo $notification ?></p>
<?php endif; ?>

    <hr />
    
    <?php //echo form_open('admin/profile/political_bias_submit',array('method' => 'post', 'class' => 'formstep formp'));?>
    <?php echo form_open('admin/profile/political_bias',array('method' => 'post', 'class' => 'formstep formp', 'id' => 'political_bias_form'));?>
    <p class="nop ">Your political view <span class="purple norm">(all information is confidential)</span></p>    
    <p><label class="w300" >How would you describe your political view? <span class="purple">*</span></label> 
    <?php    
	$political_view_list = $this->Political_party_model->admin_get_political_bias();
	if($political_view_list)
	{
		foreach($political_view_list as $key=>$value)
		{
		//$tempnetworklistings[$value[id]] = $value['name'];
			$keys[]=$value[id];
			$values[]=$value['political_bias'];
		}
	}
$political_view_listing = array_combine($keys,$values);
    /*$political_view_list = array(
      ''=>'Select Option',
      'not_say'=>'Prefer not to say',
      'conservative'=>'Conservative',
      'moderate'=>'Moderate',
      'liberal'=>'Liberal',
      'anarchist'=>'Anarchist',
    );*/
    $select_atribute = 'class="w200"';
    echo form_dropdown('political_view',$political_view_listing,$political_bias['political_view'],$select_atribute);  ?>
    </p>
    <?php echo form_error('political_view') ?> 
    
    <p class="nop ">Which political party do you align yourself with?</p>
    <hr />     
    <?php foreach($list_political_party as $politics){?>
    <p class="big">
    <input type="radio" name="political_party" <?php if ($political_bias['political_party_id'] == $politics['id']){?>checked="checked"<?php }?> value="<?php echo $politics['id']?>"/>    
    <?php if(!$politics['logo'] == ''){ // kalau gambarnya nggak kosong ?>
    <?php echo img(array('src' => base_url().'uploads/political_party/thumbnail/'.$politics['logo'], 'width' => '77', 'height' => '50'))?>         
    <?php }else{?>
    <?php echo img(array('src' => base_url().'uploads/political_party/thumbnail/blank.jpg', 'width' => '77', 'height' => '50'))?>
    <?php }?>
    <?php
	if($politics['website'] != "")
	{
	?>
	<a target="_blank" href="<?php echo $politics['website'] ?>"><?php echo $politics['name']?></a> <?php } else { echo $politics['name']; } ?><br/>  <?php
	if($politics['website'] != "")
	{
	?><span class="purple">   <a href="<?php echo $politics['website']?>" target="_blank"><?php echo $politics['website']?></a></span><?php } else { ?><span class="purple"> <?php echo $politics['website']; } ?></span>
    </p>
    <?php } echo form_error('political_party') ?>
    
    <?php 
    $form_button = array(
        'type'=>'submit',
        'name'=>'submit',
        'value'=>'submit',
        'content'=>'Submit',
    );
    echo form_button($form_button) ?>
    <div class="clear"></div>
<?php echo form_close(); ?><!-- formstep -->
</div><!-- page -->
<?php $this->load->view(TEMPLATE_NAME.'/admin/footer');?>